
hexChar = input("请输入十六进制的数: ").strip()
if '0'  <=  hexChar <= '9':
    print("十进制数：" , ord(hexChar) - ord('0'))
elif  'A' <=  hexChar <= 'F':
    print("十进制数：", ord(hexChar) - ord('A') + 10)
elif 'a' <=  hexChar <= 'f':
    print("十进制数：", ord(hexChar) - ord('a') + 10)
else:
    print("输入错误")
